@echo off

%1 mshta vbscript:CreateObject("WScript.Shell").Run("%~s0 ::",0,FALSE)(window.close)&&exit
setlocal enabledelayedexpansion

start javaw -jar D:\app\etm\etm-1.0.0.jar > D:\app\etm\log\etm.log &

:retry
ping -n 120 127.1 >nul
netstat -an|findstr 9443 >nul
if errorlevel 1 (
    goto restart
)

goto retry

:restart
start javaw -jar D:\app\etm\etm-1.0.0.jar > D:\app\etm\log\etm.log &
goto retry